import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '区域',
    align:"center",
    dataIndex: 'restHost'
   },
   {
    title: 'common key',
    align:"center",
    dataIndex: 'appKey'
   },
   {
    title: '私聊A方',
    align:"center",
    dataIndex: 'userAId'
   },
   {
    title: '私聊B方',
    align:"center",
    dataIndex: 'userBId'
   },
   {
    title: '群聊ID',
    align:"center",
    dataIndex: 'groupId'
   },
   {
    title: '岗位ID',
    align:"center",
    dataIndex: 'positionId'
   },
   {
    title: '类型：text、audio、image、video',
    align:"center",
    dataIndex: 'type'
   },
   {
    title: '消息ID',
    align:"center",
    dataIndex: 'messageId'
   },
   {
    title: '发送者ID',
    align:"center",
    dataIndex: 'senderId'
   },
   {
    title: '接收者ID',
    align:"center",
    dataIndex: 'receiverId'
   },
   {
    title: '发送时间',
    align:"center",
    dataIndex: 'sendTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '文本内容',
    align:"center",
    dataIndex: 'texts'
   },
   {
    title: '名称，针对非文本',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '内容类型：audio/m4a,image/jpeg,video/mp4等',
    align:"center",
    dataIndex: 'contentType'
   },
   {
    title: 'url地址，图片或者视频地址',
    align:"center",
    dataIndex: 'url'
   },
   {
    title: '封面地址,针对视频',
    align:"center",
    dataIndex: 'coverUrl'
   },
   {
    title: '时长，视频、音频',
    align:"center",
    dataIndex: 'duration'
   },
   {
    title: '宽度',
    align:"center",
    dataIndex: 'width'
   },
   {
    title: '高度',
    align:"center",
    dataIndex: 'height'
   },
   {
    title: '大小',
    align:"center",
    dataIndex: 'size'
   },
   {
    title: '内容信息',
    align:"center",
    dataIndex: 'payload'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'sort'
   },
   {
    title: '启用状态',
    align:"center",
    dataIndex: 'status'
   },
   {
    title: 'tenantId',
    align:"center",
    dataIndex: 'tenantId'
   },
   {
    title: '删除状态(0-正常,1-已删除)',
    align:"center",
    dataIndex: 'delFlag'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '区域',
    field: 'restHost',
    component: 'Input',
  },
  {
    label: 'common key',
    field: 'appKey',
    component: 'Input',
  },
  {
    label: '私聊A方',
    field: 'userAId',
    component: 'Input',
  },
  {
    label: '私聊B方',
    field: 'userBId',
    component: 'Input',
  },
  {
    label: '群聊ID',
    field: 'groupId',
    component: 'Input',
  },
  {
    label: '岗位ID',
    field: 'positionId',
    component: 'Input',
  },
  {
    label: '类型：text、audio、image、video',
    field: 'type',
    component: 'Input',
  },
  {
    label: '消息ID',
    field: 'messageId',
    component: 'Input',
  },
  {
    label: '发送者ID',
    field: 'senderId',
    component: 'Input',
  },
  {
    label: '接收者ID',
    field: 'receiverId',
    component: 'Input',
  },
  {
    label: '发送时间',
    field: 'sendTime',
    component: 'DatePicker',
  },
  {
    label: '文本内容',
    field: 'texts',
    component: 'Input',
  },
  {
    label: '名称，针对非文本',
    field: 'name',
    component: 'Input',
  },
  {
    label: '内容类型：audio/m4a,image/jpeg,video/mp4等',
    field: 'contentType',
    component: 'Input',
  },
  {
    label: 'url地址，图片或者视频地址',
    field: 'url',
    component: 'Input',
  },
  {
    label: '封面地址,针对视频',
    field: 'coverUrl',
    component: 'Input',
  },
  {
    label: '时长，视频、音频',
    field: 'duration',
    component: 'InputNumber',
  },
  {
    label: '宽度',
    field: 'width',
    component: 'InputNumber',
  },
  {
    label: '高度',
    field: 'height',
    component: 'InputNumber',
  },
  {
    label: '大小',
    field: 'size',
    component: 'InputNumber',
  },
  {
    label: '内容信息',
    field: 'payload',
    component: 'InputTextArea',
  },
  {
    label: '排序',
    field: 'sort',
    component: 'InputNumber',
  },
  {
    label: '启用状态',
    field: 'status',
    component: 'InputNumber',
  },
  {
    label: 'tenantId',
    field: 'tenantId',
    component: 'InputNumber',
  },
  {
    label: '删除状态(0-正常,1-已删除)',
    field: 'delFlag',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}